package action;

import dao.CartItemDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/user/action/ChangeItemNumServlet")
public class ChangeItemNumServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1.获取参数
        Integer rid =Integer.parseInt(req.getParameter("itemId"));
        Integer count = Integer.parseInt(req.getParameter("num"));
        //2.调用dao层修改方法
        CartItemDao cartItemDao = new CartItemDao();
        cartItemDao.updateByRid(rid,count);
        }
    }
